#include "Roller.h"
#include "WPILib.h"

Roller::Roller(int topChan, int botChan) :
	topMotor(topChan),
	botMotor(botChan)
{
	topMotor.SetSafetyEnabled(true);
	topMotor.SetExpiration(1.0);
	
	botMotor.SetSafetyEnabled(true);
	botMotor.SetExpiration(1.0);
}

void Roller::Spin(float speed)
{
	if (speed < -1.0) 		speed = -1;
	else if (speed > 1.0) 	speed = 1;
	
	topMotor.Set(speed);
	botMotor.Set(-speed);
}

void Roller::Rotate(float speed)
{
	if (speed < -1.0) 		speed = -1;
	else if (speed > 1.0) 	speed = 1;
	
	topMotor.Set(speed);
	botMotor.Set(speed);
}

